package com.example.nit.controller;

import com.example.nit.bean.AllCategory;
import com.example.nit.bean.NumCorrect;
import com.example.nit.bean.ValueCategory;
import com.example.nit.bean.ValueCorrect;
import com.example.nit.mapper.ValueCorrectMapper;
import com.example.nit.service.AllCategoryServiceImpl;

import com.example.nit.service.NumCorrectServiceImpl;
import com.example.nit.service.ValueCategoryServiceImpl;
import com.example.nit.service.ValueCorrectServiceImpl;
import com.example.nit.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 杨铭
 * 2022/11/30,18:16
 */
@RestController
@RequestMapping("/rdd")
public class RDDController {
    @Autowired
    AllCategoryServiceImpl allCategoryService;
    @Autowired
    ValueCategoryServiceImpl valueCategoryService;
    @Autowired
    ValueCorrectServiceImpl valueCorrectService;
    @Autowired
    NumCorrectServiceImpl numCorrectService;
    @Autowired


    @GetMapping("/valueCorrectRDD")

    public R valueCorrectRDD(){
        List<AllCategory> allCategories = allCategoryService.queryAll();

        return R.ok().put("allCategories",allCategories);

    }
    @GetMapping("/valueCategory")
    public R valueCategory(){
        List<ValueCategory> valueCategories = valueCategoryService.queryAll();
        return R.ok().put("valueCategories",valueCategories);
    }
    @GetMapping("/valueCorrect")
    public R valueCorrect(){
        List<ValueCorrect> valueCorrects = valueCorrectService.queryAll();
        return R.ok().put("valueCorrects",valueCorrects);
    }

    @GetMapping("/numCorrect")
    public R numCorrect(){
        List<NumCorrect> numCorrects = numCorrectService.queryAll();
        return R.ok().put("numCorrects",numCorrects);
    }


}

